﻿@{
    ViewBag.Title = "Login";
    Layout = null;
}
<style>
    /*h2 {
        text-align: center;
    }*/

    .txt {
        width: 250px;
        height: 25px;
        border-radius: 5px;
        /*background: #fff;*/
        border: 2px solid red;
        box-shadow: 0 0 10px red;
    }

    .txx {
        border-radius: 5px;
        /*background: green;*/
        border: 2px solid green;
        box-shadow: 0 0 10px green;
    }

    span {
        color: red;
    }
</style>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>大气简洁后台登录模板下载</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="/LoginCss/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="~/LoginCss/images/login.js"></script>
    <link href="~/LoginCss/css/login2.css" rel="stylesheet" type="text/css" />
</head>
<body>

    <h1>房地产评估用户登陆<sup></sup></h1>
    <div class="login">
        <div class="header">
            <div class="switch" id="switch">
                <a class="switch_btn_focus" id="switch_qlogin" href="javascript:void(0);" tabindex="7">登录</a>
                <a class="switch_btn" id="switch_login" href="javascript:void(0);" tabindex="8">简介</a><div class="switch_bottom" id="switch_bottom" style="position: absolute; width: 64px; left: -14px;"></div>
            </div>
        </div>

        <div class="web_qr_login" id="web_qr_login" style="display: block; height: 235px;">
            <!--登录-->
            <div class="web_login" id="web_login">
                <div class="login-box">
                    <div class="login_form">
                        <form action="" name="loginform" accept-charset="utf-8" id="login_form" class="loginForm" method="post">
                            <input type="hidden" name="did" value="0" />
                            <input type="hidden" name="to" value="log" />
                            <div class="uinArea" id="uinArea">
                                <label class="input-tips" for="u" style="font-size:16px;">帐号：</label>
                                <div class="inputOuter" id="uArea">
                                    <input type="text" id="textName" name="Users_Account" class="inputstyle" /><span id="s1"></span>
                                </div>
                            </div>
                            <div class="pwdArea" id="pwdArea">
                                <label class="input-tips" for="p">密码：</label>
                                <div class="inputOuter" id="pArea">
                                    <input type="password" id="textPwd" name="Users_Pwd" class="inputstyle" /><span id="s2"></span>
                                </div>
                            </div>
                            <div style="padding-left:50px;margin-top:20px;"><input type="button" onclick="FunLogin()" value="登 录" style="width:150px;" class="button_blue" /></div>
                        </form>
                    </div>
                </div>
            </div>
            <!--登录end-->
        </div>

        <!--注册-->
        @*<div class="qlogin" id="qlogin" style="display: none; ">

                <div class="web_login">
                    <form name="form2" id="regUser" accept-charset="utf-8" action="" method="post">
                        <input type="hidden" name="to" value="reg" />
                        <input type="hidden" name="did" value="0" />
                        <ul class="reg_form" id="reg-ul">
                            <li>

                                <label for="user" class="input-tips2">用户名：</label>
                                <div class="inputOuter2">
                                    <input type="text" id="textuser" name="user" maxlength="16" class="inputstyle2" />
                                </div>

                            </li>

                            <li>
                                <label for="passwd" class="input-tips2">密码：</label>
                                <div class="inputOuter2">
                                    <input type="password" id="textpasswd1" name="passwd" maxlength="16" class="inputstyle2" />
                                </div>

                            </li>
                            <li>
                                <label for="passwd2" class="input-tips2">确认密码：</label>
                                <div class="inputOuter2">
                                    <input type="password" id="textpasswd2" name="" maxlength="16" class="inputstyle2" />
                                </div>

                            </li>

                            <li>
                                <label for="qq" class="input-tips2">性别：</label>
                                <div style="padding-top:16px">

                                    <input type="radio" name="sex" value="0" />男<input type="radio" name="sex" value="1" />女

                                </div>

                            </li>
                            <li>
                                    <label for="qq" class="input-tips2">职位：</label>
                                    <div style="padding-top:16px">

                                        <select id="Szhiwei">
                                            @{
                                                foreach (var i in Model)
                                                {
                                                    <option value="@i.RoleID">@i.RoleName</option>
                                                }
                                            }
                                        </select>

                                    </div>

                                </li>
                            <li>
                                <label for="qq" class="input-tips2">验证码：</label>

                                <input type="text" id="yanzheng" style="width:110px;height:28px" /><img alt="看不清，换一张" src="~/Handler1.ashx" style="height:22px; width:100px;padding-top:8px; cursor:pointer" onclick="this.src = '/Handler1.ashx?id=' + new Date()" />


                            </li>
                            <li>
                                <div class="inputArea">
                                    <input type="button" id="reg" style="margin-top:10px;margin-left:85px;" class="button_blue" value="注册" onclick="FunAddUserInfo()" />
                                </div>

                            </li>
                        </ul>
                    </form>
                </div>
            </div>*@
        <!--注册end-->
        <!--简介-->
        <div class="qlogin" id="qlogin" style="display: none; ">

            <div class="web_login">
                <form name="form2" id="regUser" accept-charset="utf-8" action="" method="post">
                    <input type="hidden" name="to" value="reg" />
                    <input type="hidden" name="did" value="0" />
                    <div style="margin-left:90px;">
                        <h2 style="color:#0094ff;">房地产评估有限公司</h2>
                    </div>
                    <p style="margin-left:20px;margin-right:20px;font-size:14px;">
                        <span style="color:#0094ff;font-size:20px;font-weight:bold;">首</span>先，公司是快餐式的工作方式，本着全方面为顾客着想的工作理念，公司提供的流程也是非常的清晰，简单易懂，
                        下发项目后，由公司的勘察员进行实地考察，并拍照全方面上传照片，保证房屋的完整性，维护顾客利益，再提交由
                        评估员对该房屋进行评估价位等等，最终进行审核，不通过驳回重新勘察，也是为了客户的不满意而进行二次调整，
                        全方位保证客户的利益不受到损失，您的支持让我们共赢，欢迎加入我们公司！
                    </p>
                </form>
            </div>
        </div>
        <!--简介end-->
    </div>
</body>
</html>
<script>
    load();
    function load() {
        $("#textName").focus();
    }

    // 准备文档 ,获取回车按钮
    $(function () {
        document.onkeydown = function (e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                FunLogin();
            }
        }
    });

    function FunLogin() {
        var name = $("#textName").val();
        var pwd1 = $("#textPwd").val();
        $.ajax({
            type: "post",
            url: "/Login/LoginDo",
            data: {
                Users_Account: name,
                Users_Pwd: pwd1,
            },
            success: function (obj) {
                if (obj == 2) {
                    alert("登录成功!");
                    location.href = "/House/Index";
                }
                if (obj == 1) {
                    alert("密码错误");
                }
                if (obj == 0) {
                    alert("用户不存在");
                }
                if (obj == 3) {
                    alert("用户已停用，请联系管理员");
                }
            }
        });
    }

    $(function () {
        //用户名
        $("#textName").focus(function () {
            $("#textName").addClass("txt");
        })
        $("#textName").blur(function () {
            $("#textName").removeClass("txt");

            if ($("#textName").val() == null || $("#textName").val() == "") {
                $("#s1").text("用户名不能为空!");
            }
            else {
                $("#s1").text("");
                $("#textName").addClass("txx");
            }
        })

        //密码
        $("#textPwd").focus(function () {
            $("#textPwd").addClass("txt");
        })
        $("#textPwd").blur(function () {
            $("#textPwd").removeClass("txt");

            if ($("#textPwd").val() == null || $("#textPwd").val() == "") {
                $("#s2").text("密码不能为空!");
            }
            else {
                $("#s2").text("");
                $("#textPwd").addClass("txx");
            }
        })
    })
</script>
